<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, maximum-scale = 1, minimum-scale=1" />
		<meta name="apple-mobile-web-app-capable" content="yes" />
		<meta name="viewport" content="target-densitydpi=device-dpi,width=640,user-scalable=0">
		<title>车栈-车栈加油</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />

		<script src="js/mui.min.js"></script>
		<script src="js/app.js"></script>
		<script type="text/javascript" src="js/jquery-1.8.2.min.js"></script>

	</head>

	<body>
		<section class="section">

			<div class="pos-top" style="margin-top: -80px;">
				<div class="csxuanze">
					<select class="list">
						<option selected="" value="1">全部油号</option>
						<option value="2">95#</option>
						<option value="3">5#</option>
					</select>
					<select class="list">
						<option selected="" value="1">离我最近</option>
						<option value="2">100KM</option>
						<option value="3">200KM</option>
					</select>
				</div>
				<div class="gas_list">
					<ul id="data_list">

					</ul>
				</div>

			</div>
			<!--底部导航-->

		</section>
	</body>

</html>
<script>
	(function(mui, doc) {
		mui.init({
			statusBarBackground: '#000000'
		});
		mui("body").on("tap", ".gopage", function() {

			var this_obj = jQuery(this);
			var url = this_obj.data("url");
			var id = this_obj.data("param");
			//  mui.toast(id);
			mui.openWindow({
				id: url,
				url: url,
				extras: {
					data_id: id,
				},
				waiting: {
					autoShow: false,
				}
			})
		});
		mui.plusReady(function() {

			var self = plus.webview.currentWebview();
			var id = self.data_id;

			getGasList();

		});

	}(mui, document));

	function getGasList() {

		var postData = {
			apiUrl: web_url + "page_gas/gaslist.shtml",
			datas: {

			}
		};
		app.postServer(postData,
			function(result) {
				var html = "";
				$.each(result.data, function(index, item) {
					console.log(resource_url + item.thumb);
					html += '<li class="gopage" data-url="gas_detail.html" data-param="'+item.id+'"><div class="gastu"><img src="' + resource_url + item.thumb + '"></div>' +
						'<a  >' + item.name + '</a>' +
						'<span>' + item.address + '</span>' +
						'</li>';

				});

				$("#data_list").html(html);

			},
			function(err) {
				if(err) {
					plus.nativeUI.toast(err);
					return;
				}
			}
		);

	}
</script>